package com.fa7.android.example.listafacil;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class SQLHelper extends SQLiteOpenHelper {

	private String createSQL;
	
	public SQLHelper(Context context, String name, int version, String createSQL) {
		super(context, name, null, version);
		this.createSQL = createSQL;
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(createSQL);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE " + CompraDB.TABLE_NAME);
		onCreate(db);
	}

}
